home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / grafica / amhelios / ct_delta.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  2KB  |  83 lines

  1. ////////////////////////////////////////////////////////////
  2. //
  3. //  CT_DELTA.H- Cubic Tetrahedron Delta Form Factor Class
  4. //
  5. //  Version:    1.03A
  6. //
  7. //  History:    94/08/23 - Version 1.00A release.
  8. //              94/12/16 - Version 1.01A release.
  9. //              95/02/05 - Version 1.02A release.
  10. //              95/07/21 - Version 1.02B release.
  11. //              96/02/14 - Version 1.02C release.
  12. //              96/04/01 - Version 1.03A release.
  13. //
  14. //  Compilers:  Microsoft Visual C/C++ Professional V1.5
  15. //              Borland C++ Version 4.5
  16. //
  17. //  Author:     Ian Ashdown, P.Eng.
  18. //              byHeart Software Limited
  19. //              620 Ballantree Road
  20. //              West Vancouver, B.C.
  21. //              Canada V7S 1W3
  22. //              Tel. (604) 922-6148
  23. //              Fax. (604) 987-7621
  24. //
  25. //  Copyright 1994-1996 byHeart Software Limited
  26. //
  27. //  The following source code has been derived from:
  28. //
  29. //    Ashdown, I. 1994. Radiosity: A Programmer's
  30. //    Perspective. New York, NY: John Wiley & Sons.
  31. //
  32. //  It may be freely copied, redistributed, and/or modified
  33. //  for personal use ONLY, as long as the copyright notice
  34. //  is included with all source code files.
  35. //
  36. ////////////////////////////////////////////////////////////
  37.  
  38. #ifndef _CT_DELTA_H
  39. #define _CT_DELTA_H
  40.  
  41. #include "general.h"
  42. #include "ff_delta.h"
  43.  
  44. // Delta form factor array size
  45. static const CT_DeltaDim = FF_ArrayRes / 2;
  46. static const int CT_FormDim = CT_DeltaDim * CT_DeltaDim +
  47.     CT_DeltaDim;
  48.  
  49. // Cubic tetrahedron face co-ordinate limits
  50. static const double CT_MinCoord = -2.0;
  51. static const double CT_MaxCoord = 1.0;
  52.  
  53. class CubicDelta    // Cubic tetrahedron delta form factors
  54. {
  55.   private:
  56.     // Delta form factor row pointer array
  57.     static float *delta_array[CT_DeltaDim];
  58.  
  59.     // Delta form factor array
  60.     static float ff_array[CT_FormDim];
  61.  
  62.   public:
  63.     CubicDelta();
  64.  
  65.     // Get delta form factor
  66.     float GetFactor( int row, int col )
  67.     {
  68.       int temp;         // Temporary variable
  69.  
  70.       if (row > col)
  71.       {
  72.         temp = row;
  73.         row = col;
  74.         col = temp;
  75.       }
  76.  
  77.       return delta_array[row][col - row];
  78.     }
  79. };
  80.  
  81. #endif
  82.  
  83.